﻿using System;

namespace OpenLS.Spreadsheet
{
    internal class StringFormula : ConstantFormula
    {
        private string _value;

        public StringFormula(string substring)
        {
            this._value = substring;
        }

        public override string Text
        {
            get
            {
                string q = "\"";
                return q + _value.Replace( q, q+q) + q;
            }
        }

        internal override object GetValue()
        {
            return _value;
        }

        public override CellFormulaBase Offset(CellRelativeAddress cellRelativeAddress)
        {
            return this;
        }
    }
}